From 987866b845db063abf2e46dcf5e475c8d159b11a Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 3 May 2005 15:40:15 +0000 Subject: [PATCH] Fix leak when first name in token is a vowel. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1145 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/mkshort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index fc3304ba1..ce45907b8 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -187,9 +187,10 @@ delete_last_vowel(int start, char *istring, int *replaced) *replaced = 0; for (l = strlen(istring); l > start; l--) { if (strchr(vowels, istring[l-1])) { - char *ostring = xstrdup(istring); + char *ostring; /* If vowel is the first letter of a word, keep it.*/ if (istring[l-2] == ' ') continue; + ostring = xstrdup(istring); strncpy(&ostring[l-1], &istring[l], 1+strlen(istring)-l); ostring[strlen(istring)-1] = 0; *replaced = 1; -- 2.30.2